'use strict'

let obj = {
  name: 'rich',
  key: 1234,
  id: 1029238,
  text: 'nothing'
}

console.log(Object.keys(obj))
for (let k in obj) {
  console.log(k)
}

let obj2 = {}
let arr = [1,3,7,4,5]

arr.forEach(x => {
  obj2[x] = x
})

console.log( Object.keys(obj2) )

let m = new Map()

m.set('name', 'rich')
m.set('key', 1234)

if (m.has('id')) {
  console.log('id is', m.get('id'))
} else {
  m.set('id', 12345)
}

for (let [k,v] of m) {
  console.log(k, v)
}

console.log(m.size)
